import { uploadAsset } from "./upload-asset";
import {
  getDefaultImageFormatStyle
} from "@/logics/shortcutkey";
// 完成保存网址操作, 这个封面图是可视区域的截图
export const captureVisibleShortcut = async requestData => {
  let formatStyle = await getDefaultImageFormatStyle()
  const screenshot = await chrome.tabs.captureVisibleTab(null, {format: formatStyle});
  return await uploadAsset({ base64: screenshot });
};

// 完成可视区域的截图
export const captureVisibleScreenShot = async () => {
  let formatStyle = await getDefaultImageFormatStyle()
  const screenshot = await chrome.tabs.captureVisibleTab(null, {format: formatStyle});
  console.log("获取到base64", screenshot)
  return { base64: screenshot };
};
